package com.ruiyi.adrobot.beans.dto;

import com.ruiyi.adrobot.beans.Device;
import com.ruiyi.adrobot.beans.TaskDetail;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by kennedy on 2017/7/18.
 */
public class TaskExcuteBaseInfo {
    private String excuteSimCode = null;
    private Device excuteDevice = null;
    private Integer errorCode = 0;  // 0:正确  1 没有可用Robot 2 老用户不足 3 设备型号不足 4 获取vpn失败 5未知异常
    List<TaskDetail.Task.TaskDynamicInfo> taskDynamicInfos = new LinkedList<>();
    private VpnInfo vpnInfo;

    public VpnInfo getVpnInfo() {
        return vpnInfo;
    }

    public void setVpnInfo(VpnInfo vpnInfo) {
        this.vpnInfo = vpnInfo;
    }

    public static class VpnInfo {
        private String ip;
        private String username;
        private String password;
        private Integer online;


        public VpnInfo() {
        }

        public VpnInfo(String ip, String username, String password, Integer online) {
            this.ip = ip;
            this.username = username;
            this.password = password;
            this.online = online;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public Integer getOnline() {
            return online;
        }

        public void setOnline(Integer online) {
            this.online = online;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getIp() {
            return ip;
        }

        public void setIp(String ip) {
            this.ip = ip;
        }
    }

    public TaskExcuteBaseInfo() {
    }

    public TaskExcuteBaseInfo(int errorCode) {
        this.errorCode = errorCode;
    }

    public List<TaskDetail.Task.TaskDynamicInfo> getTaskDynamicInfos() {
        return taskDynamicInfos;
    }

    public void setTaskDynamicInfos(List<TaskDetail.Task.TaskDynamicInfo> taskDynamicInfos) {
        this.taskDynamicInfos = taskDynamicInfos;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getExcuteSimCode() {
        return excuteSimCode;
    }

    public void setExcuteSimCode(String excuteSimCode) {
        this.excuteSimCode = excuteSimCode;
    }

    public Device getExcuteDevice() {
        return excuteDevice;
    }

    public void setExcuteDevice(Device excuteDevice) {
        this.excuteDevice = excuteDevice;
    }

    public static TaskExcuteBaseInfo errorCode(int errorCode) {
        return new TaskExcuteBaseInfo(errorCode);
    }
}
